package com.ysd.lis.util.CA;


public class TestMain {

	public static void main(String[] args) {
		
		Hmac hmac=new Hmac();
		String message;
		//注册
		//message="appId=APP_87BD03920D6D4D3DA22C729EB162BA38&idNumber=370205198506020299&idType=SF&mobile=18745292622&signAlgo=HMAC&userName=赵六&version=1.0";
		//message="uniqueId=0001&appId=APP_87BD03920D6D4D3DA22C729EB162BA38&idNumber=370205198506020774&idType=SF&mobile=18745292622&signAlgo=HMAC&userName=李四&version=1.0";
		//message="appId=APP_0157E810F6894BEEB4DEC70331720557&idNumber=370205198506020379&idType=SF&mobile=18745292622&signAlgo=HMAC&userName=赵武&version=1.0";
		
		//查询用户信息
		//message="idNumber=370283199001222614&idType=SF&mobile=15865566913&signAlgo=HMAC&userName=王有先&version=1.0&appId=APP_0157E810F6894BEEB4DEC70331720557";
		//message="idType=SF&idNumber=370283199001222614&signAlgo=HMAC&version=1.0&appId=APP_87BD03920D6D4D3DA22C729EB162BA38";
		//message="uniqueId=0001&signAlgo=HMAC&version=1.0&appId=APP_87BD03920D6D4D3DA22C729EB162BA38";
		//获取激活码
		//message="idType=SF&signAlgo=HMAC&userId=a7fcbf3ce53f49146ad569fcb72152983597eeb0388024194fe9bda50abe349d&version=1.0&appId=APP_0157E810F6894BEEB4DEC70331720557&idNumber=370283199001222614&userName=王有先";
		//产生激活码
		//message="signAlgo=HMAC&userId=058629f0f473ea121f72e059f16d1be3d5ea111c49da7b7d8eb3944d36cb8cf0&version=1.0&appId=APP_87BD03920D6D4D3DA22C729EB162BA38";
		//message="signAlgo=HMAC&userId=a7fcbf3ce53f49146ad569fcb72152983597eeb0388024194fe9bda50abe349d&version=1.0&appId=APP_0157E810F6894BEEB4DEC70331720557";
		//添加签名任务		
		//message="data=546L5pyJ5YWI562+5ZCN5rWL6K+V&expiryDate=1440&description=签名数据的描述位置描述信息&title=测试签名&dataType=DATA&algo=SM3withSM2&signAlgo=HMAC&userId=0eba015f9f0aa13937a747c48d64206976d46da9e137636508b31554d0a94fcd&version=1.0&appId=APP_87BD03920D6D4D3DA22C729EB162BA38";
		//message="data=546L5pyJ5YWI562+5ZCN5rWL6K+V&expiryDate=1440&description=签名数据的描述位置描述信息&title=测试签名&dataType=DATA&algo=SM3withSM2&signAlgo=HMAC&userId=a7fcbf3ce53f49146ad569fcb72152983597eeb0388024194fe9bda50abe349d&version=1.0&appId=APP_0157E810F6894BEEB4DEC70331720557";
		//获取签名结果
		//message="signAlgo=HMAC&signDataId=SD_045f03e1-bd38-4388-9c69-4c097b77283e&version=1.0&appId=APP_0157E810F6894BEEB4DEC70331720557";
		//验证签名值
		//message="cert=MIIDAjCCAqagAwIBAgISIALLq2UahcX9i848Es5KQeJZMAwGCCqBHM9VAYN1BQAwPjELMAkGA1UEBgwCQ04xDTALBgNVBAoMBEJKQ0ExDTALBgNVBAsMBEJKQ0ExETAPBgNVBAMMCExPQ0FMU00yMB4XDTIwMDkyMjA3MTUwMloXDTI1MDkyMjA3MTUwMlowcDELMAkGA1UEBgwCQ04xDzANBgNVBAMMBui1teatpjFQME4GCgmSJomT8ixkAQEMQDRmZmU1NTMyYjFjMWVjMWE5NDcxNjkwZmM1YWJiNmEyMzBlMTAyOGUzMjJlNzNmZmZhZjEwZWMxYTljNzVhY2QwWTATBgcqhkjOPQIBBggqgRzPVQGCLQNCAASxy58bqz4I64tva8H2fK0rweqkD3ytYvRBQQKZ6HNlknK7/NE3jBgQxmLLaX9sOEHCzXbOPNrjHT93nrE9/vvso4IBTjCCAUowCwYDVR0PBAQDAgbAMAkGA1UdEwQCMAAwEwYDVR0lBAwwCgYIKwYBBQUHAwMwgYUGA1UdHwR+MHwwOKA2oDSGMmh0dHBzOi8vY3JsLmlzaWduZXQuY24vY3JsL0xPQ0FMU00yL0xPQ0FMU00yXzAuY3JsMECgPqA8hjpodHRwczovL2NybC5pc2lnbmV0LmNuL2NybC9MT0NBTFNNMi9pbmMvTE9DQUxTTTJfaW5jXzAuY3JsMB0GA1UdDgQWBBTNKfVHIAmsIw5p2b7euKRymbwIETAfBgNVHSMEGDAWgBQ78fsiTPugyfgIrS+tCqf3oTpz1zBTBgNVHSAETDBKMEgGCiqBHIbvMgYEAQEwOjA4BggrBgEFBQcCARYsaHR0cHM6Ly9jcmwuaXNpZ25ldC5jbi9jcHMvTE9DQUxTTTIvY3BzLmh0bWwwDAYIKoEcz1UBg3UFAANIADBFAiBaApVfH5frOQWCPwr63UA5Y5RlPnmHQtqLWQN2rBZt3gIhAIzVnaBMGCQj0Xx20ekIFTCuazRfXoPqiSitBBuPWIoS&signValue=MEQCIGHoQGyLToPRgYC0/+jPeAq34eSNPyZEKKC+oQ9nMsh7AiA4KLWSlFfNIrbHzQ8jpTGSKFxHCQ0Rp0YB8LfeA6MjIQ==&plain=546L5pyJ5YWI562+5ZCN5rWL6K+V&signAlg=SM3withSM2&signAlgo=HMAC&version=1.0&appId=APP_0157E810F6894BEEB4DEC70331720557";
		//开启自动签名
		//message="timeRegion=14400&signAlgo=HMAC&userId=0eba015f9f0aa13937a747c48d64206976d46da9e137636508b31554d0a94fcd&version=1.0&appId=APP_87BD03920D6D4D3DA22C729EB162BA38";
		//自动签名
		message="signToken=SD_8c99300e-aca0-46ab-9001-80adead33065&data=6LW15q2m5byA5ZCv5Yy76ZmiQuiHquWKqOetvizmjojmnYPmnInmlYjmnJ/kuLoxNDQwMOenkg==&expiryDate=1440&description=签名数据描述信息&title=自动签名测试&dataType=DATA&algo=SM3withSM2&signAlgo=HMAC&userId=0eba015f9f0aa13937a747c48d64206976d46da9e137636508b31554d0a94fcd&version=1.0&appId=APP_87BD03920D6D4D3DA22C729EB162BA38";
		//修改印章图片
		//message="status=ACTIVE&signAlgo=HMAC&userId=0eba015f9f0aa13937a747c48d64206976d46da9e137636508b31554d0a94fcd&version=1.0&appId=APP_87BD03920D6D4D3DA22C729EB162BA38&image=R0lGODlhYwA3APcAAAAAAP///wIAAggCCAQBBAoECggECAYDBgQCBAMCAwsICw0KDSohKiEaIRIPEgYFBhMQEw4MDgcGBxYTFggHCDkzO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CffiFWLE1HV4UPYCWMu";
		String secret="cCgK8MyNlbbpDHqc5u9BtKSP2qv010UP";
		//String secret="BLyxiQItwokAF7DXnzFkrYCm20EYnlkR";
		message=hmac.ascii(message);
		String hash=hmac.hmac(message, secret);
		System.out.println(hash);
		System.out.println(hmac.ascii(message));
		String str="{\"id\":\"APP_7B3F36A14E99410A80B37AEF332E3247\",\"sUrl\":\"http://112.255.140.55:8759/coss/mobile/v1/getServiceInfo\",\"o\":\"KHE0DgQEUHoQY3VndTBqaVxAVRdtU1NQCGBnZTENXVxCcAMdCQgsNzYxC0NWQnYHEh0aOSojNU1KRyEJdX4TFG8lNiIcGQocYggSABZ9cS4=\",\"cv\":\"2.0\"}";
		String  a="\\\\";
		 str=str.replaceAll(a,"");
		System.out.println(str);

}
}
